from  selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
import  time
window=webdriver.Chrome();
window.maximize_window();
window.get('http://jwc.mypt.edu.cn')

time.sleep(1)
window.find_element_by_xpath('//*[@id="__01"]/tbody/tr[4]/td/table/tbody/tr/td[1]/table/tbody/tr[3]/td/a/img').click()
name=window.find_element_by_name('user')
pwd=window.find_element_by_name('pwd')
ac=ActionChains(window)
de=ActionChains(window)

ac.move_to_element(name).click(name).key_up('201800097',name).perform()
de.move_to_element(pwd).click(pwd).key_up('jt20519',pwd).perform()
pwd.send_keys(Keys.ENTER)
window.find_element_by_xpath('//*[@id="__01"]/tbody/tr[6]/td/a').click()
time.sleep(3)
window.back()
window.find_element_by_xpath('//*[@id="__01"]/tbody/tr[2]/td/a').click()
pt=window.find_element_by_xpath('//*[@id="__01"]/tbody/tr[3]/td/table[2]/tbody/tr/td/center/table[3]/tbody/tr[2]/td[6]/a').text
print(pt)
window.find_element_by_xpath('//*[@id="__01"]/tbody/tr[2]/td/table/tbody/tr/td[10]/a').click()
time.sleep(1)
window.close()
